<?php
//管理端路由

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
//Route::get('/login', [\App\Http\Controllers\Wx\UserController::class, 'login'])->name('wx.index');

//$api->get('/v1/csg.community.communitysubject.join', 'CommSubController@joinCommunityOrSubject');//加入社区或者话题

//用户登陆
Route::post('/login', [\App\Http\Controllers\Manage\UserController::class, 'login']);
//领券人导入，公开 todo: 上线后需注释
//Route::post('/recevier/importopen', [\App\Http\Controllers\Manage\ReceiverController::class, 'importReceiverOpen']);
//删除领券人，临时使用 todo: 上线后需注释
//Route::post('/recevier/delreceivertest', [\App\Http\Controllers\Manage\CommonController::class, 'delReceiverTest']);

//领券人列表导出
Route::get('/receiver/exportlist', [\App\Http\Controllers\Manage\ReceiverController::class, 'exportList']);
//券核销列表导出
Route::get('/coupon/exportlist', [\App\Http\Controllers\Manage\CouponController::class, 'exportList']);

//领券人导入文件转换，用于支持微信小程序政务识别插件的名单导入
Route::post('/receiver/receiverfileconvert', [\App\Http\Controllers\Manage\CommonController::class, 'receiverFileConvert']);
//协助人导入文件转换，用于支持微信小程序政务识别插件的名单导入
Route::post('/assistant/assistantfileconvert', [\App\Http\Controllers\Manage\CommonController::class, 'assistantFileConvert']);

Route::middleware(['auth:sanctum', 'rbac.check'])->group(function () {

    //退出登陆
    Route::post('/logout', [\App\Http\Controllers\Manage\UserController::class, 'logout']);

    //图片上传云，公共
    Route::post('/common/uploadpic', [\App\Http\Controllers\Manage\CommonController::class, 'uploadPic']);

    //获取用户信息
    Route::get('/user/loginuserinfo', [\App\Http\Controllers\Manage\UserController::class, 'loginUserInfo']);

    //首页信息展示
    Route::get('/home/index', [\App\Http\Controllers\Manage\HomeController::class, 'index']);

    //用户列表
    Route::get('/user/list', [\App\Http\Controllers\Manage\UserController::class, 'list']);
    //保存用户信息
    Route::post('/user/save', [\App\Http\Controllers\Manage\UserController::class, 'save']);
    //用户编辑回显信息
    Route::get('/user/editshow', [\App\Http\Controllers\Manage\UserController::class, 'editShow']);
    //修改用户状态
    Route::post('/user/updatestatus', [\App\Http\Controllers\Manage\UserController::class, 'updateStatus']);

    //通用-活动列表
    Route::get('/common/activitylist', [\App\Http\Controllers\Manage\CommonController::class, 'activityList']);
    //修改用户密码
    Route::post('/user/updateapssword', [\App\Http\Controllers\Manage\UserController::class, 'updatePassword']);

    //活动列表
    Route::get('/activity/list', [\App\Http\Controllers\Manage\ActivityController::class, 'list']);
    //活动编辑回显
    Route::get('/activity/editshow', [\App\Http\Controllers\Manage\ActivityController::class, 'editShow']);
    //活动编辑保存
    Route::post('/activity/editsave', [\App\Http\Controllers\Manage\ActivityController::class, 'editSave']);
    //活动删除
    Route::post('/activity/del', [\App\Http\Controllers\Manage\ActivityController::class, 'del']);
//    //活动图片上传云预签名
//    Route::get('/activity/picpresignurl', [\App\Http\Controllers\Manage\ActivityController::class, 'picPreSignUrl']);
//    //活动上传图片至云
//    Route::post('/activity/uploadpic', [\App\Http\Controllers\Manage\ActivityController::class, 'uploadPic']);
//
    //受助人列表
    Route::get('/receiver/list', [\App\Http\Controllers\Manage\ReceiverController::class, 'list']);
    //受助人删除
    Route::post('/receiver/del', [\App\Http\Controllers\Manage\ReceiverController::class, 'del']);
    //受助人基本信息
    Route::get('/receiver/baseinfo', [\App\Http\Controllers\Manage\ReceiverController::class, 'baseInfo']);
    //受助人修改领取资格
    Route::post('/receiver/updatereceiverstatus', [\App\Http\Controllers\Manage\ReceiverController::class, 'updateReceiverStatus']);
    //受助人领取优惠券列表
    Route::get('/receiver/couponlist', [\App\Http\Controllers\Manage\ReceiverController::class, 'couponList']);
    //受助人导入验证
    Route::post('/receiver/importverify', [\App\Http\Controllers\Manage\ReceiverController::class, 'importReceiverVerify']);
    //受助人导入
    Route::post('/receiver/import', [\App\Http\Controllers\Manage\ReceiverController::class, 'importReceiver']);
    //受助人导入模板url
    Route::get('/receiver/importtemplateurl', [\App\Http\Controllers\Manage\ReceiverController::class, 'importTemplateUrl']);

    //助餐点列表
    Route::get('/restaurant/list', [\App\Http\Controllers\Manage\RestaurantController::class, 'list']);
    //助餐点基本信息
    Route::get('/restaurant/baseinfo', [\App\Http\Controllers\Manage\RestaurantController::class, 'baseInfo']);
    //助餐点审核状态更新
    Route::post('/restaurant/updateauthstatus', [\App\Http\Controllers\Manage\RestaurantController::class, 'updateAuthStatus']);
    //用餐记录-列表
    Route::get('/restaurant/dinnerloglist', [\App\Http\Controllers\Manage\RestaurantController::class, 'dinnerLogList']);
    //用餐记录-列表导出
    Route::get('/restaurant/dinnerloglistexport', [\App\Http\Controllers\Manage\RestaurantController::class, 'dinnerLogListExport']);
    //助餐点结算-未结算列表
    Route::get('/restaurant/unsettleaccountlist', [\App\Http\Controllers\Manage\RestaurantController::class, 'unSettleAccountList']);
    //助餐点结算-未结算详情
    Route::get('/restaurant/unsettleaccountinfo', [\App\Http\Controllers\Manage\RestaurantController::class, 'unSettleAccountInfo']);
    //助餐点结算-结算操作
    Route::post('/restaurant/settleaccountoperate', [\App\Http\Controllers\Manage\RestaurantController::class, 'settleAccountOperate']);
    //助餐点结算-已结算列表
    Route::get('/restaurant/settledaccountlist', [\App\Http\Controllers\Manage\RestaurantController::class, 'settledAccountList']);
    //助餐点计算-已结算详情
    Route::get('/restaurant/settledAccountInfo', [\App\Http\Controllers\Manage\RestaurantController::class, 'settledAccountInfo']);
    //助餐点-列表标签统计
    Route::get('/restaurant/listlabelstatistic', [\App\Http\Controllers\Manage\RestaurantController::class, 'listLabelStatistic']);
    //助餐点结算-结算列表标签统计
    Route::get('/restaurant/settledaccountlistlabelstatistic', [\App\Http\Controllers\Manage\RestaurantController::class, 'settledAccountListLabelStatistic']);

    //获取券批次展示信息
    Route::get('/coupon/getstockshowinfo', [\App\Http\Controllers\Manage\CouponController::class, 'getStockShowInfo']);
    //优惠券记录-列表
    Route::get('/coupon/sendtasklist', [\App\Http\Controllers\Manage\CouponController::class, 'sendTaskList']);
    //优惠券记录-详情
    Route::get('/coupon/sendtaskinfo', [\App\Http\Controllers\Manage\CouponController::class, 'sendTaskInfo']);

    //协助者-列表
    Route::get('/assistant/list', [\App\Http\Controllers\Manage\AssistantController::class, 'list']);
    //协助者-导入验证提示
    Route::post('/assistant/importassistantverify', [\App\Http\Controllers\Manage\AssistantController::class, 'importAssistantVerify']);
    //协助者-导入数据
    Route::post('/assistant/importassistant', [\App\Http\Controllers\Manage\AssistantController::class, 'importAssistant']);
    //协助人-导入模板下载url
    Route::get('/assistant/importtemplateurl', [\App\Http\Controllers\Manage\AssistantController::class, 'importTemplateUrl']);

    //首页-信息展示
    Route::get('/home/index', [\App\Http\Controllers\Manage\HomeController::class, 'index']);

});
